<?php
 $con = mysqli_connect("127.0.0.1","root","","posts");

 $basename = basename($_FILES['avatar']['name']);
 $uploadfile = "../img/".$basename;
 move_uploaded_file($_FILES['avatar']['tmp_name'], $uploadfile);
 
 $avatar = $basename;
 $name = $_POST['username'];
 $email = $_POST['email'];
 $password = $_POST['password'];
 $birthday =  $_POST['birthday'];
 mysqli_query($con,"INSERT INTO info (avatar, name, email,password,birthday)
            VALUES ('$avatar', '$name', '$email','$password','$birthday')");
 
 
 mysqli_close($con);
 
 echo "<script>window.location='../html/login.html'</script>";
?>